package com.example.statemachine.core;

import lombok.Data;
import java.util.function.Supplier;

@Data
public class TransitionRequest<T> {
    private StateEnum currentState;
    private EventEnum event;
    private StateEnum targetState;
    private StateMachineContext context;
    private Supplier<T> entityLoader;  // 使用泛型Supplier

    public TransitionRequest(StateEnum currentState, EventEnum event, StateMachineContext context) {
        this.currentState = currentState;
        this.event = event;
        this.context = context;
    }

    public TransitionRequest(StateEnum currentState, EventEnum event,
                             StateMachineContext context, Supplier<T> entityLoader) {
        this.currentState = currentState;
        this.event = event;
        this.context = context;
        this.entityLoader = entityLoader;
    }
}